public class CaseListViewController {


    public List<Case> caselist{get;set;}
    public List<Casewrapper> wrapperlist{get;set;}
    
    public CaseListViewController(ApexPages.StandardController controller) {

        DisplayallCases();
    }
    
    public void DisplayallCases(){
    
    String userid=userInfo.getuserId();
    
    caselist=[select id,CaseNumber,Status,Subject from Case where CreatedBy.Id=:userid];
        
        
        wrapperlist=new List<Casewrapper>();
        
        for(Case casevar: caselist){
        
            Casewrapper wrapper=new Casewrapper();
            wrapper.caseId=casevar.Id;
            wrapper.casenumber=casevar.CaseNumber;
            wrapper.subject=casevar.Subject;                 
            wrapperlist.add(wrapper);
        
        }
    
    }
    
    public class Casewrapper{
    
        public String caseId{get;set;}
        public String caseaccountId{get;set;}
        public String caseaccountname{get;set;}
        public String casenumber{get;set;}
        public String subject{get;set;}
        public String querytype{get;set;}
        public String subtype{get;set;}
    }
    
    
     public pageReference CreateCase(){
           
        pageReference pageref=new pageReference('/apex/Casecreatepage');        
        return pageref;
    }
    
    public static testmethod void testCaseListViewController () {
    
        Case c=new Case();
        insert c;
        ApexPages.StandardController controller = new ApexPages.StandardController(new Case());
        CaseListViewController caselistview=new CaseListViewController(controller);
        caselistview.CreateCase();
    }

}